package com.download.backstage.controller;

import com.download.web.service.BusBuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/backstage/buy")
public class BusBuyController {
    @Autowired
    private BusBuyService busBuyService;

    @RequestMapping("/selectAll")
    public String selectAll(@RequestParam(value = "startTime",defaultValue = "") String startTime,@RequestParam(value = "endTime",defaultValue = "") String endTime,@RequestParam(value = "page",defaultValue = "1") int page,@RequestParam(value = "limit",defaultValue = "10") int limit, Model model){
        Map<String,Object> list=busBuyService.selectAll(startTime,endTime,page,limit);
        model.addAttribute("buyList",list);
        return "backstage/paylist";
    }
}
